import API from '@/api/api.js';
import http from '@/api/http';

var Tools = {

  getProvince: function(callback) {
    http.get(API.API_COMMON_PROVINCE,{})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getCity: function (params, callback) {
    http.get(API.API_COMMON_CITY, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getAdminCity: function (params, callback) {
    http.get(API.API_COMMON_ADMINCITY, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getAdminCityInfo: function (params, callback) {
    http.get(API.API_COMMON_ADMINCITY_INFO, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getCityType: function (callback) {
    http.get(API.API_COMMON_CITYTYPE, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getBrands: function (callback) {
    http.get(API.API_COMMON_BRAND)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getDealerLevels: function (params,callback) {
    http.get(API.API_COMMON_DEALER_LEVEL, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getBuList: function (callback) {
    http.get(API.API_COMMON_BU, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getDestinations: function (callback) {
    http.get(API.API_COMMON_DESTINATION, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getFeeStatus: function (callback) {
    http.get(API.API_COMMON_FEE_STATUS, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getCooperationStatus: function (callback) {
    http.get(API.API_COMMON_COOPERATION_STATUS, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getBussinessStatus: function (callback) {
    http.get(API.API_COMMON_BUSSINESS_STATUS, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },
  
  getVendor: function (params, callback) {
    http.get(API.API_STORE_VENDOR, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getPaylink: function (params, callback) {
    http.get(API.API_STORE_PAYLINK, params)
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getStoreType: function(callback) {
    http.get(API.API_COMMON_STORE_TYPE, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getLocationList: function (callback) {
    http.get(API.API_COMMON_LOCATION_LIST, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getisLkaList: function (callback) {
    http.get(API.API_COMMON_ISLKA_LIST, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },
  
  getStoreInvestType: function(callback) {
    http.get(API.API_COMMON_STORE_INVEST_TYPE, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  },

  getDealerType: function(callback) {
    http.get(API.API_SUPPLYMODE_LIST, {})
        .then(resp => {
          if (typeof callback == 'function') {callback(resp)}
        })
  }

}

export default Tools;
